import {
  IsBoolean,
  IsDate,
  IsEmail,
  IsEnum,
  IsPhoneNumber,
  Length,
  ValidateIf,
  Validator
} from "class-validator";
import { Column, Entity, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
import { Thesis } from "@src/apps/thesis/entities/item.entity"
export enum Gender {
  Female = "female",
  Male = "male"
}
export const MAX_CARD_LENGTH = 16;
const MAX_DEPARTMENT_LENGTH = 32;
const MAX_EMAIL_LENGTH = 64;
const MAX_MOBILE_LENGTH = 16; 
export const MAX_NAME_LENGTH = 64;
@Entity("account_user")
export class User {
  @Column("boolean", {default: false })
  @IsBoolean()
  dangling: boolean;

  @Column("varchar", { length: MAX_NAME_LENGTH })
  @Length(1, MAX_NAME_LENGTH)
  name: string;

  @PrimaryColumn("varchar", {
    length: MAX_CARD_LENGTH,
    unique: true
  })
  @Length(1, MAX_CARD_LENGTH)
  id: string; // card

  @OneToOne(() => Thesis, (thesis) => thesis.user)
    thesis: Thesis
  // @OneToOne(
  //   type => WeChatUser,
  //   weChatUser => weChatUser.user
  // )
  // weChatUser: WeChatUser | null;


}